package com.work.demo.strategy;

public class Sorter {

	/**
	 * 选择排序
	 */
	public static void sort(int[] arr) {

		for (int i = 0; i < arr.length - 1; i++) {
			int minPos = i;
			for (int j = i + 1; j < arr.length; j++) {
				minPos = arr[j] < arr[minPos] ? j : minPos;
			}
			swap(arr, i, minPos);
		}

	}

	static void swap(int[] arr, int i, int j) {
		int temp = arr[i];
		arr[i] = arr[j];
		arr[j] = temp;
	}


	public static void main(String[] args) {
		int size;
		size = 2 << 25;
		System.out.println(size);
		int[] arr = new int[10];
		for (int i = 0; i < 9; i++) {
			arr[i] = i;
		}
		sort(arr);
	}

}
